#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long LL;
typedef double db;
inline int read()
{
	int x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') { if(ch=='-')f=-1; ch=getchar(); }
	while(ch>='0'&&ch<='9') { x=(x<<1)+(x<<3)+ch-'0'; ch=getchar(); }
	return x*f;
}
const int MAXN=9;
int n,m,s,d,r,infor[MAXN][MAXN],cnt,T,grade,target,_x[]={0,1,0,-1},_y[]={1,0,-1,0};
bool can[MAXN][MAXN];
struct ant
{
	int mx,lev,hp,age,x,y,lstx,lsty;
	bool alive,carry;
	bool operator<(const ant b)const
	{
		return (!(alive^b.alive))?age>b.age:alive;
	}
}a[7];
struct turret
{
	int x,y;
}tu[21];
struct line
{
	int a,b,c,x1,x2,y1,y2;
}l;
int cal_mx(int k)
{
	return int(pow(1.1,k)*4);
}
void new_ant()
{
	int k;
	for(k=1;k<=6;++k)
		if(!a[k].alive)break;
	a[k].mx=a[k].hp=cal_mx(grade/6+1);
	a[k].lev=grade/6+1;
	a[k].age=1;
	a[k].x=a[k].y=a[k].lstx=a[k].lsty=0;
	a[k].alive=true;
	a[k].carry=false;
	can[0][0]=true;
	++grade;
	++cnt;
	return;
}
void cal_infor()
{
	for(int i=1;i<=cnt;++i)
		if(!a[i].carry)infor[a[i].x][a[i].y]+=2;
		else infor[a[i].x][a[i].y]+=5;
	return;
}
bool can_move(int u,int x,int y)
{
	if(x<0||y<0||x>n||y>m)return false;
	if(can[x][y])return false;
	if(x==a[u].lstx&&y==a[u].lsty)return false;
	return true;
}
void move(int u,int dir)
{
	int x=a[u].x,y=a[u].y;
	if(dir==-1)
	{
		a[u].lstx=x;
		a[u].lsty=y;
		return;
	}
	int xx=a[u].x+_x[dir],yy=a[u].y+_y[dir];
	can[x][y]=false;
	can[xx][yy]=true;
	a[u].lstx=x;a[u].lsty=y;
	a[u].x=xx;a[u].y=yy;
	return;
}
void special_move(int u,int dir)
{
	int x=a[u].x,y=a[u].y;
	for(int i=(dir-1+4)%4;;i=(i-1+4)%4)
	{
		int xx=x+_x[i],yy=y+_y[i];
		if(can_move(u,xx,yy))
		{
			move(u,i);
			break;
		}
	}
	return;
}
void cal_move(int u)
{
	int x=a[u].x,y=a[u].y,mx=-0x3f3f3f3f,dir=-1;
	for(int i=0;i<4;++i)
	{
		int xx=x+_x[i],yy=y+_y[i];
		if(can_move(u,xx,yy)&&infor[xx][yy]>mx)mx=infor[xx][yy];
	}
	for(int i=0;i<4;++i)
	{
		int xx=x+_x[i],yy=y+_y[i];
		if(can_move(u,xx,yy)&&infor[xx][yy]==mx)
		{
			dir=i;
			break;
		}
	}
	if(a[u].age%5!=0||dir==-1)move(u,dir);
	else special_move(u,dir);
	return;
}
void get_cake(int u)
{
	a[u].hp=min(a[u].hp+a[u].mx/2,a[u].mx);
	a[u].carry=true;
	target=u;
	return;
}
int cal_dispp(int u,int v)
{
	return (tu[u].x-a[v].x)*(tu[u].x-a[v].x)+(tu[u].y-a[v].y)*(tu[u].y-a[v].y);
}
db cal_displ(int u)
{
	return abs(l.a*a[u].x+l.b*a[u].y+l.c)/sqrt(l.a*l.a+l.b*l.b);
}
void attack(int u)
{
	int v=0;
	if(target&&cal_dispp(u,target)<=r*r)v=target;
	else
	{
		int mn=0x3f3f3f3f;
		for(int i=1;i<=cnt;++i)
		{
			int k=cal_dispp(u,i);
			if(k<=r*r&&k<mn)
			{
				v=i;
				mn=k;
			}
		}
	}
	if(!v)return;
	l.x1=tu[u].x;l.y1=tu[u].y;
	l.x2=a[v].x;l.y2=a[v].y;
	l.a=l.y2-l.y1;
	l.b=l.x1-l.x2;
	l.c=-l.x1*l.y2+l.x2*l.y1;
	for(int i=1;i<=cnt;++i)
		if(cal_displ(i)<=0.5&&a[i].x>=min(l.x1,l.x2)&&a[i].x<=max(l.x1,l.x2)&&a[i].y>=min(l.y1,l.y2)&&a[i].y<=max(l.y1,l.y2))a[i].hp-=d;
	return;
}
void die(int u)
{
	a[u].alive=false;
	can[a[u].x][a[u].y]=false;
	if(a[u].carry)target=0;
	return;
}
bool work()
{
	if(cnt!=6&&!can[0][0])new_ant();
	sort(a+1,a+7);
	cal_infor();
	for(int i=1;i<=cnt;++i)
		if(a[i].carry)target=i;
	for(int i=1;i<=cnt;++i)
		cal_move(i);
	if(!target)
		for(int i=1;i<=cnt;++i)
			if(a[i].x==n&&a[i].y==m)get_cake(i);
	for(int i=1;i<=s;++i)
		attack(i);
	for(int i=1;i<=cnt;++i)
		if(a[i].hp<0)die(i);
	cnt=0;
	for(int i=1;i<=6;++i)
		if(a[i].alive)++cnt;
	if(a[target].alive&&!a[target].x&&!a[target].y)return true;
	for(int i=0;i<=n;++i)
		for(int j=0;j<=m;++j)
			if(infor[i][j])--infor[i][j];
	for(int i=1;i<=6;++i)
		if(a[i].alive)++a[i].age;
	return false;
}
void print()
{
	sort(a+1,a+7);
	printf("%d\n",cnt);
	for(int i=1;i<=cnt;++i)
		printf("%d %d %d %d %d\n",a[i].age-1,a[i].lev,a[i].hp,a[i].x,a[i].y);
	return;
}
int main()
{
	n=read();m=read();s=read();d=read();r=read();
	for(int i=1;i<=s;++i)tu[i].x=read(),tu[i].y=read(),can[tu[i].x][tu[i].y]=true;
	T=read();
	for(int i=1;i<=T;++i)
	{
		if(work())
		{
			printf("Game over after %d seconds\n",i);
			print();
			return 0;
		}
	}
	puts("The game is going on");
	print();
	return 0;
}
